package net.jjjshop.front.controller.user;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import net.jjjshop.common.entity.user.User;
import net.jjjshop.framework.common.api.ApiResult;
import net.jjjshop.framework.log.annotation.OperationLog;
import net.jjjshop.front.param.user.UserParam;
import net.jjjshop.front.service.user.UserRechargeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * 充值活动
 *
 * @author 武子
 * @date 2025/3/3
 */
@Slf4j
@Api(value = "user", tags = {"充值活动"})
@RestController
@RequestMapping("/front/user/recharge")
public class UserRechargeController {

    @Autowired
    private UserRechargeService userRechargeService;

    @RequestMapping(value = "/upd", method = RequestMethod.POST)
    @OperationLog(name = "upd")
    @ApiOperation(value = "upd", response = String.class)
    public ApiResult<Boolean> receipt(@Validated @RequestBody User user) {
        return ApiResult.ok(userRechargeService.updRecharge(user));
    }
}
